** user = XXX
** password = XXX
** package = STATA
** project = GSOEP 


*---------------------*
*** 1. Prepare data ***
*---------------------*

*** load data
use "SOEP_long_final.dta", clear // need to enter correct file name here

*** code Kreis uenmployment rates in 1993 and 2018 (manually)
* 1993
gen kreis_unemprate1993 = .
replace kreis_unemprate1993 = 12.31 if kkz_rek == 1001
replace kreis_unemprate1993 = 11.44 if kkz_rek == 1002
replace kreis_unemprate1993 = 11.49 if kkz_rek == 1003
replace kreis_unemprate1993 = 9.96 if kkz_rek == 1004
replace kreis_unemprate1993 = 9.37 if kkz_rek == 1051
replace kreis_unemprate1993 = 6.69 if kkz_rek == 1053
replace kreis_unemprate1993 = 8.24 if kkz_rek == 1054
replace kreis_unemprate1993 = 8.54 if kkz_rek == 1055
replace kreis_unemprate1993 = 6.65 if kkz_rek == 1056
replace kreis_unemprate1993 = 7.63 if kkz_rek == 1057
replace kreis_unemprate1993 = 8.24 if kkz_rek == 1058
replace kreis_unemprate1993 = 7.94 if kkz_rek == 1059
replace kreis_unemprate1993 = 5.81 if kkz_rek == 1060
replace kreis_unemprate1993 = 7.91 if kkz_rek == 1061
replace kreis_unemprate1993 = 5.31 if kkz_rek == 1062
replace kreis_unemprate1993 = 8.5 if kkz_rek == 2000
replace kreis_unemprate1993 = 11.16 if kkz_rek == 3101
replace kreis_unemprate1993 = 12.9 if kkz_rek == 3102
replace kreis_unemprate1993 = 12.14 if kkz_rek == 3103
replace kreis_unemprate1993 = 11.71 if kkz_rek == 3151
replace kreis_unemprate1993 = 10.84 if kkz_rek == 3152
replace kreis_unemprate1993 = 11.18 if kkz_rek == 3153
replace kreis_unemprate1993 = 11.44 if kkz_rek == 3154
replace kreis_unemprate1993 = 10.59 if kkz_rek == 3155
replace kreis_unemprate1993 = 12.29 if kkz_rek == 3156
replace kreis_unemprate1993 = 8.94 if kkz_rek == 3157
replace kreis_unemprate1993 = 8.94 if kkz_rek == 3158
replace kreis_unemprate1993 =  if kkz_rek == 3201
replace kreis_unemprate1993 = 7.05 if kkz_rek == 3251
replace kreis_unemprate1993 = 10.54 if kkz_rek == 3252
replace kreis_unemprate1993 =  if kkz_rek == 3253
replace kreis_unemprate1993 = 9.75 if kkz_rek == 3254
replace kreis_unemprate1993 = 11.23 if kkz_rek == 3255
replace kreis_unemprate1993 = 8.04 if kkz_rek == 3256
replace kreis_unemprate1993 = 7.99 if kkz_rek == 3257
replace kreis_unemprate1993 = 8.75 if kkz_rek == 3351
replace kreis_unemprate1993 = 8.45 if kkz_rek == 3352
replace kreis_unemprate1993 = 6.35 if kkz_rek == 3353
replace kreis_unemprate1993 = 15.81 if kkz_rek == 3354
replace kreis_unemprate1993 = 9.01 if kkz_rek == 3355
replace kreis_unemprate1993 = 7.93 if kkz_rek == 3356
replace kreis_unemprate1993 = 6.34 if kkz_rek == 3357
replace kreis_unemprate1993 = 7.9 if kkz_rek == 3358
replace kreis_unemprate1993 = 7.38 if kkz_rek == 3359
replace kreis_unemprate1993 = 9.79 if kkz_rek == 3360
replace kreis_unemprate1993 = 6.61 if kkz_rek == 3361
replace kreis_unemprate1993 = 10.16 if kkz_rek == 3401
replace kreis_unemprate1993 = 14.22 if kkz_rek == 3402
replace kreis_unemprate1993 = 10.78 if kkz_rek == 3403
replace kreis_unemprate1993 = 11.35 if kkz_rek == 3404
replace kreis_unemprate1993 = 16.35 if kkz_rek == 3405
replace kreis_unemprate1993 = 8.66 if kkz_rek == 3451
replace kreis_unemprate1993 = 12.09 if kkz_rek == 3452
replace kreis_unemprate1993 = 9.57 if kkz_rek == 3453
replace kreis_unemprate1993 = 9.85 if kkz_rek == 3454
replace kreis_unemprate1993 = 11.36 if kkz_rek == 3455
replace kreis_unemprate1993 = 9.86 if kkz_rek == 3456
replace kreis_unemprate1993 = 12.15 if kkz_rek == 3457
replace kreis_unemprate1993 = 7.88 if kkz_rek == 3458
replace kreis_unemprate1993 = 7.5 if kkz_rek == 3459
replace kreis_unemprate1993 = 6.5 if kkz_rek == 3460
replace kreis_unemprate1993 = 9.56 if kkz_rek == 3461
replace kreis_unemprate1993 = 13.14 if kkz_rek == 3462
replace kreis_unemprate1993 = 11.44 if kkz_rek == 4011
replace kreis_unemprate1993 = 15.86 if kkz_rek == 4012
replace kreis_unemprate1993 = 10.11 if kkz_rek == 5111
replace kreis_unemprate1993 = 13.26 if kkz_rek == 5112
replace kreis_unemprate1993 = 11.35 if kkz_rek == 5113
replace kreis_unemprate1993 = 11.64 if kkz_rek == 5114
replace kreis_unemprate1993 = 10.16 if kkz_rek == 5116
replace kreis_unemprate1993 = 8.68 if kkz_rek == 5117
replace kreis_unemprate1993 = 12.61 if kkz_rek == 5119
replace kreis_unemprate1993 = 7.93 if kkz_rek == 5120
replace kreis_unemprate1993 = 8.94 if kkz_rek == 5122
replace kreis_unemprate1993 = 9.68 if kkz_rek == 5124
replace kreis_unemprate1993 = 8.64 if kkz_rek == 5154
replace kreis_unemprate1993 = 7.55 if kkz_rek == 5158
replace kreis_unemprate1993 = 7.14 if kkz_rek == 5162
replace kreis_unemprate1993 = 8.1 if kkz_rek == 5166
replace kreis_unemprate1993 = 9.74 if kkz_rek == 5170
replace kreis_unemprate1993 = 12.45 if kkz_rek == 5313
replace kreis_unemprate1993 = 6.74 if kkz_rek == 5314
replace kreis_unemprate1993 = 11.61 if kkz_rek == 5315
replace kreis_unemprate1993 = 10.5 if kkz_rek == 5316
replace kreis_unemprate1993 = 10.54 if kkz_rek == 5354
replace kreis_unemprate1993 = 8.69 if kkz_rek == 5358
replace kreis_unemprate1993 = 7.19 if kkz_rek == 5362
replace kreis_unemprate1993 = 6.87 if kkz_rek == 5366
replace kreis_unemprate1993 = 9.93 if kkz_rek == 5370
replace kreis_unemprate1993 = 9.6 if kkz_rek == 5374
replace kreis_unemprate1993 = 7.84 if kkz_rek == 5378
replace kreis_unemprate1993 = 6.4 if kkz_rek == 5382
replace kreis_unemprate1993 = 12.08 if kkz_rek == 5512
replace kreis_unemprate1993 = 13.7 if kkz_rek == 5513
replace kreis_unemprate1993 = 7.58 if kkz_rek == 5515
replace kreis_unemprate1993 = 7.8 if kkz_rek == 5554
replace kreis_unemprate1993 = 6.3 if kkz_rek == 5558
replace kreis_unemprate1993 = 11.46 if kkz_rek == 5562
replace kreis_unemprate1993 = 6.91 if kkz_rek == 5566
replace kreis_unemprate1993 = 7.23 if kkz_rek == 5570
replace kreis_unemprate1993 = 9.8 if kkz_rek == 5711
replace kreis_unemprate1993 = 6.39 if kkz_rek == 5754
replace kreis_unemprate1993 = 7.31 if kkz_rek == 5758
replace kreis_unemprate1993 = 7.86 if kkz_rek == 5762
replace kreis_unemprate1993 = 8.15 if kkz_rek == 5766
replace kreis_unemprate1993 = 8.24 if kkz_rek == 5770
replace kreis_unemprate1993 = 8.73 if kkz_rek == 5774
replace kreis_unemprate1993 = 12.02 if kkz_rek == 5911
replace kreis_unemprate1993 = 13.45 if kkz_rek == 5913
replace kreis_unemprate1993 = 10.93 if kkz_rek == 5914
replace kreis_unemprate1993 = 10.65 if kkz_rek == 5915
replace kreis_unemprate1993 = 14.06 if kkz_rek == 5916
replace kreis_unemprate1993 = 9.76 if kkz_rek == 5954
replace kreis_unemprate1993 = 6.54 if kkz_rek == 5958
replace kreis_unemprate1993 = 9.53 if kkz_rek == 5962
replace kreis_unemprate1993 = 7.37 if kkz_rek == 5966
replace kreis_unemprate1993 = 7.67 if kkz_rek == 5970
replace kreis_unemprate1993 = 7.3 if kkz_rek == 5974
replace kreis_unemprate1993 = 10.49 if kkz_rek == 5978
replace kreis_unemprate1993 = 6.55 if kkz_rek == 6411
replace kreis_unemprate1993 = 7.64 if kkz_rek == 6412
replace kreis_unemprate1993 = 8.06 if kkz_rek == 6413
replace kreis_unemprate1993 = 5.83 if kkz_rek == 6414
replace kreis_unemprate1993 = 6.3 if kkz_rek == 6431
replace kreis_unemprate1993 = 5.11 if kkz_rek == 6432
replace kreis_unemprate1993 = 4.72 if kkz_rek == 6433
replace kreis_unemprate1993 = 4.63 if kkz_rek == 6434
replace kreis_unemprate1993 = 7.11 if kkz_rek == 6435
replace kreis_unemprate1993 = 3.97 if kkz_rek == 6436
replace kreis_unemprate1993 = 6.03 if kkz_rek == 6437
replace kreis_unemprate1993 = 5.01 if kkz_rek == 6438
replace kreis_unemprate1993 = 4.51 if kkz_rek == 6439
replace kreis_unemprate1993 = 5.61 if kkz_rek == 6440
replace kreis_unemprate1993 = 8.71 if kkz_rek == 6531
replace kreis_unemprate1993 = 9.19 if kkz_rek == 6532
replace kreis_unemprate1993 = 6.11 if kkz_rek == 6533
replace kreis_unemprate1993 = 7.36 if kkz_rek == 6534
replace kreis_unemprate1993 = 8.25 if kkz_rek == 6535
replace kreis_unemprate1993 = 12.75 if kkz_rek == 6611
replace kreis_unemprate1993 = 6.5 if kkz_rek == 6631
replace kreis_unemprate1993 = 9.55 if kkz_rek == 6632
replace kreis_unemprate1993 = 7.26 if kkz_rek == 6633
replace kreis_unemprate1993 = 8.57 if kkz_rek == 6634
replace kreis_unemprate1993 = 8.25 if kkz_rek == 6635
replace kreis_unemprate1993 = 10.75 if kkz_rek == 6636
replace kreis_unemprate1993 = 6.87 if kkz_rek == 7111
replace kreis_unemprate1993 = 5.7 if kkz_rek == 7131
replace kreis_unemprate1993 = 6.76 if kkz_rek == 7132
replace kreis_unemprate1993 = 8.5 if kkz_rek == 7133
replace kreis_unemprate1993 = 9.26 if kkz_rek == 7134
replace kreis_unemprate1993 = 6.89 if kkz_rek == 7135
replace kreis_unemprate1993 = 6.31 if kkz_rek == 7137
replace kreis_unemprate1993 = 5.76 if kkz_rek == 7138
replace kreis_unemprate1993 = 8.48 if kkz_rek == 7140
replace kreis_unemprate1993 = 5.85 if kkz_rek == 7141
replace kreis_unemprate1993 = 5.86 if kkz_rek == 7143
replace kreis_unemprate1993 = 9.51 if kkz_rek == 7211
replace kreis_unemprate1993 = 7.38 if kkz_rek == 7231
replace kreis_unemprate1993 = 7.2 if kkz_rek == 7232
replace kreis_unemprate1993 = 7.35 if kkz_rek == 7233
replace kreis_unemprate1993 = 5.93 if kkz_rek == 7235
replace kreis_unemprate1993 = 7.7 if kkz_rek == 7311
replace kreis_unemprate1993 = 12.48 if kkz_rek == 7312
replace kreis_unemprate1993 = 7.61 if kkz_rek == 7313
replace kreis_unemprate1993 = 8.24 if kkz_rek == 7314
replace kreis_unemprate1993 = 6.19 if kkz_rek == 7315
replace kreis_unemprate1993 = 7.41 if kkz_rek == 7316
replace kreis_unemprate1993 = 14.81 if kkz_rek == 7317
replace kreis_unemprate1993 = 7.46 if kkz_rek == 7318
replace kreis_unemprate1993 = 9.18 if kkz_rek == 7319
replace kreis_unemprate1993 = 12.04 if kkz_rek == 7320
replace kreis_unemprate1993 = 6.49 if kkz_rek == 7331
replace kreis_unemprate1993 = 5.66 if kkz_rek == 7332
replace kreis_unemprate1993 = 9.77 if kkz_rek == 7333
replace kreis_unemprate1993 = 7.2 if kkz_rek == 7334
replace kreis_unemprate1993 = 10.21 if kkz_rek == 7335
replace kreis_unemprate1993 = 10.76 if kkz_rek == 7336
replace kreis_unemprate1993 = 6.76 if kkz_rek == 7337
replace kreis_unemprate1993 = 4.96 if kkz_rek == 7338
replace kreis_unemprate1993 = 4.8 if kkz_rek == 7339
replace kreis_unemprate1993 = 10.31 if kkz_rek == 7340
replace kreis_unemprate1993 = 6.63 if kkz_rek == 8111
replace kreis_unemprate1993 = 4.99 if kkz_rek == 8115
replace kreis_unemprate1993 = 4.83 if kkz_rek == 8116
replace kreis_unemprate1993 = 6.82 if kkz_rek == 8117
replace kreis_unemprate1993 = 5.27 if kkz_rek == 8118
replace kreis_unemprate1993 = 5.24 if kkz_rek == 8119
replace kreis_unemprate1993 = 8.96 if kkz_rek == 8121
replace kreis_unemprate1993 = 6.21 if kkz_rek == 8125
replace kreis_unemprate1993 = 5.2 if kkz_rek == 8126
replace kreis_unemprate1993 = 5.18 if kkz_rek == 8127
replace kreis_unemprate1993 = 6.65 if kkz_rek == 8128
replace kreis_unemprate1993 = 6.49 if kkz_rek == 8135
replace kreis_unemprate1993 = 7.1 if kkz_rek == 8136
replace kreis_unemprate1993 = 5.18 if kkz_rek == 8211
replace kreis_unemprate1993 = 6.74 if kkz_rek == 8212
replace kreis_unemprate1993 = 5.2 if kkz_rek == 8215
replace kreis_unemprate1993 = 5.48 if kkz_rek == 8216
replace kreis_unemprate1993 = 7.64 if kkz_rek == 8221
replace kreis_unemprate1993 = 9.66 if kkz_rek == 8222
replace kreis_unemprate1993 = 6.9 if kkz_rek == 8225
replace kreis_unemprate1993 = 6.02 if kkz_rek == 8226
replace kreis_unemprate1993 = 8.44 if kkz_rek == 8231
replace kreis_unemprate1993 = 4.76 if kkz_rek == 8235
replace kreis_unemprate1993 = 5.44 if kkz_rek == 8236
replace kreis_unemprate1993 = 5.34 if kkz_rek == 8237
replace kreis_unemprate1993 = 9.08 if kkz_rek == 8311
replace kreis_unemprate1993 = 4.84 if kkz_rek == 8315
replace kreis_unemprate1993 = 5.79 if kkz_rek == 8316
replace kreis_unemprate1993 = 6 if kkz_rek == 8317
replace kreis_unemprate1993 = 6.69 if kkz_rek == 8325
replace kreis_unemprate1993 = 7.76 if kkz_rek == 8326
replace kreis_unemprate1993 = 7.94 if kkz_rek == 8327
replace kreis_unemprate1993 = 6.48 if kkz_rek == 8335
replace kreis_unemprate1993 = 6.08 if kkz_rek == 8336
replace kreis_unemprate1993 = 6.98 if kkz_rek == 8337
replace kreis_unemprate1993 = 6.46 if kkz_rek == 8415
replace kreis_unemprate1993 = 6.25 if kkz_rek == 8416
replace kreis_unemprate1993 = 7 if kkz_rek == 8417
replace kreis_unemprate1993 = 6.35 if kkz_rek == 8421
replace kreis_unemprate1993 = 5.39 if kkz_rek == 8425
replace kreis_unemprate1993 = 4.59 if kkz_rek == 8426
replace kreis_unemprate1993 = 5.69 if kkz_rek == 8435
replace kreis_unemprate1993 = 5.26 if kkz_rek == 8436
replace kreis_unemprate1993 = 6.18 if kkz_rek == 8437
replace kreis_unemprate1993 = 9.29 if kkz_rek == 9161
replace kreis_unemprate1993 = 5.56 if kkz_rek == 9162
replace kreis_unemprate1993 = 7.52 if kkz_rek == 9163
replace kreis_unemprate1993 = 5.64 if kkz_rek == 9171
replace kreis_unemprate1993 = 6.04 if kkz_rek == 9172
replace kreis_unemprate1993 = 5.23 if kkz_rek == 9173
replace kreis_unemprate1993 = 4.08 if kkz_rek == 9174
replace kreis_unemprate1993 = 3.69 if kkz_rek == 9175
replace kreis_unemprate1993 = 5.89 if kkz_rek == 9176
replace kreis_unemprate1993 = 3.94 if kkz_rek == 9177
replace kreis_unemprate1993 = 4.09 if kkz_rek == 9178
replace kreis_unemprate1993 = 3.95 if kkz_rek == 9179
replace kreis_unemprate1993 = 5.12 if kkz_rek == 9180
replace kreis_unemprate1993 = 5.07 if kkz_rek == 9181
replace kreis_unemprate1993 = 4.52 if kkz_rek == 9182
replace kreis_unemprate1993 = 6.56 if kkz_rek == 9183
replace kreis_unemprate1993 = 3.77 if kkz_rek == 9184
replace kreis_unemprate1993 = 5.89 if kkz_rek == 9185
replace kreis_unemprate1993 = 6.86 if kkz_rek == 9186
replace kreis_unemprate1993 = 5.38 if kkz_rek == 9187
replace kreis_unemprate1993 = 3.6 if kkz_rek == 9188
replace kreis_unemprate1993 = 5.95 if kkz_rek == 9189
replace kreis_unemprate1993 = 4.79 if kkz_rek == 9190
replace kreis_unemprate1993 = 6.86 if kkz_rek == 9261
replace kreis_unemprate1993 = 9.2 if kkz_rek == 9262
replace kreis_unemprate1993 = 9.98 if kkz_rek == 9263
replace kreis_unemprate1993 = 8.24 if kkz_rek == 9271
replace kreis_unemprate1993 = 11.24 if kkz_rek == 9272
replace kreis_unemprate1993 = 6.35 if kkz_rek == 9273
replace kreis_unemprate1993 = 5.07 if kkz_rek == 9274
replace kreis_unemprate1993 = 9.31 if kkz_rek == 9275
replace kreis_unemprate1993 = 10.44 if kkz_rek == 9276
replace kreis_unemprate1993 = 6.73 if kkz_rek == 9277
replace kreis_unemprate1993 = 7.06 if kkz_rek == 9278
replace kreis_unemprate1993 = 6.41 if kkz_rek == 9279
replace kreis_unemprate1993 = 11.9 if kkz_rek == 9361
replace kreis_unemprate1993 = 9.65 if kkz_rek == 9362
replace kreis_unemprate1993 = 8.26 if kkz_rek == 9363
replace kreis_unemprate1993 = 9.81 if kkz_rek == 9371
replace kreis_unemprate1993 = 10.5 if kkz_rek == 9372
replace kreis_unemprate1993 = 5.93 if kkz_rek == 9373
replace kreis_unemprate1993 = 7.13 if kkz_rek == 9374
replace kreis_unemprate1993 = 6.04 if kkz_rek == 9375
replace kreis_unemprate1993 = 9.25 if kkz_rek == 9376
replace kreis_unemprate1993 = 7.31 if kkz_rek == 9377
replace kreis_unemprate1993 = 8.14 if kkz_rek == 9461
replace kreis_unemprate1993 = 8.21 if kkz_rek == 9462
replace kreis_unemprate1993 = 8.18 if kkz_rek == 9463
replace kreis_unemprate1993 = 9.31 if kkz_rek == 9464
replace kreis_unemprate1993 = 6.1 if kkz_rek == 9471
replace kreis_unemprate1993 = 7.15 if kkz_rek == 9472
replace kreis_unemprate1993 = 6.48 if kkz_rek == 9473
replace kreis_unemprate1993 = 6.66 if kkz_rek == 9474
replace kreis_unemprate1993 = 7.64 if kkz_rek == 9475
replace kreis_unemprate1993 = 6.89 if kkz_rek == 9476
replace kreis_unemprate1993 = 6.1 if kkz_rek == 9477
replace kreis_unemprate1993 = 5.54 if kkz_rek == 9478
replace kreis_unemprate1993 = 9.46 if kkz_rek == 9479
replace kreis_unemprate1993 = 6.81 if kkz_rek == 9561
replace kreis_unemprate1993 = 6.85 if kkz_rek == 9562
replace kreis_unemprate1993 = 9.63 if kkz_rek == 9563
replace kreis_unemprate1993 = 8.18 if kkz_rek == 9564
replace kreis_unemprate1993 = 5.95 if kkz_rek == 9565
replace kreis_unemprate1993 = 4.9 if kkz_rek == 9571
replace kreis_unemprate1993 = 5.26 if kkz_rek == 9572
replace kreis_unemprate1993 = 6.85 if kkz_rek == 9573
replace kreis_unemprate1993 = 5.59 if kkz_rek == 9574
replace kreis_unemprate1993 = 4.81 if kkz_rek == 9575
replace kreis_unemprate1993 = 5.13 if kkz_rek == 9576
replace kreis_unemprate1993 = 5.66 if kkz_rek == 9577
replace kreis_unemprate1993 = 8.14 if kkz_rek == 9661
replace kreis_unemprate1993 = 12.9 if kkz_rek == 9662
replace kreis_unemprate1993 = 6.78 if kkz_rek == 9663
replace kreis_unemprate1993 = 5.35 if kkz_rek == 9671
replace kreis_unemprate1993 = 7.88 if kkz_rek == 9672
replace kreis_unemprate1993 = 9.06 if kkz_rek == 9673
replace kreis_unemprate1993 = 8.65 if kkz_rek == 9674
replace kreis_unemprate1993 = 7.11 if kkz_rek == 9675
replace kreis_unemprate1993 = 6.35 if kkz_rek == 9676
replace kreis_unemprate1993 = 5.43 if kkz_rek == 9677
replace kreis_unemprate1993 = 7.88 if kkz_rek == 9678
replace kreis_unemprate1993 = 4.34 if kkz_rek == 9679
replace kreis_unemprate1993 = 8.51 if kkz_rek == 9761
replace kreis_unemprate1993 = 8.63 if kkz_rek == 9762
replace kreis_unemprate1993 = 7.71 if kkz_rek == 9763
replace kreis_unemprate1993 = 6.1 if kkz_rek == 9764
replace kreis_unemprate1993 = 5.38 if kkz_rek == 9771
replace kreis_unemprate1993 = 5.31 if kkz_rek == 9772
replace kreis_unemprate1993 = 3.99 if kkz_rek == 9773
replace kreis_unemprate1993 = 5.19 if kkz_rek == 9774
replace kreis_unemprate1993 = 5.64 if kkz_rek == 9775
replace kreis_unemprate1993 = 4.83 if kkz_rek == 9776
replace kreis_unemprate1993 = 5.9 if kkz_rek == 9777
replace kreis_unemprate1993 = 4.49 if kkz_rek == 9778
replace kreis_unemprate1993 = 4.6 if kkz_rek == 9779
replace kreis_unemprate1993 = 5.86 if kkz_rek == 9780
replace kreis_unemprate1993 = 12.8 if kkz_rek == 10041
replace kreis_unemprate1993 = 10.05 if kkz_rek == 10042
replace kreis_unemprate1993 = 10.54 if kkz_rek == 10043
replace kreis_unemprate1993 = 11.58 if kkz_rek == 10044
replace kreis_unemprate1993 = 8.85 if kkz_rek == 10045
replace kreis_unemprate1993 = 8.16 if kkz_rek == 10046
replace kreis_unemprate1993 = 12.3 if kkz_rek == 11000
replace kreis_unemprate1993 = 15 if kkz_rek == 12051
replace kreis_unemprate1993 = 11.6 if kkz_rek == 12052
replace kreis_unemprate1993 = 14.3 if kkz_rek == 12053
replace kreis_unemprate1993 = 8.4 if kkz_rek == 12054
replace kreis_unemprate1993 = 14.38 if kkz_rek == 12060
replace kreis_unemprate1993 = 13.66 if kkz_rek == 12061
replace kreis_unemprate1993 = 18.05 if kkz_rek == 12062
replace kreis_unemprate1993 = 18.89 if kkz_rek == 12063
replace kreis_unemprate1993 = 15.66 if kkz_rek == 12064
replace kreis_unemprate1993 = 15.91 if kkz_rek == 12065
replace kreis_unemprate1993 = 17.09 if kkz_rek == 12066
replace kreis_unemprate1993 = 13.87 if kkz_rek == 12067
replace kreis_unemprate1993 = 18.41 if kkz_rek == 12068
replace kreis_unemprate1993 = 10.21 if kkz_rek == 12069
replace kreis_unemprate1993 = 19.45 if kkz_rek == 12070
replace kreis_unemprate1993 = 16.28 if kkz_rek == 12071
replace kreis_unemprate1993 = 15.94 if kkz_rek == 12072
replace kreis_unemprate1993 = 21.02 if kkz_rek == 12073
replace kreis_unemprate1993 = 14.2 if kkz_rek == 13003
replace kreis_unemprate1993 = 12 if kkz_rek == 13004
replace kreis_unemprate1993 = 18.62 if kkz_rek == 13071
replace kreis_unemprate1993 = 18.16 if kkz_rek == 13072
replace kreis_unemprate1993 = 19.84 if kkz_rek == 13073
replace kreis_unemprate1993 = 16.57 if kkz_rek == 13074
replace kreis_unemprate1993 = 20.98 if kkz_rek == 13075
replace kreis_unemprate1993 = 16.09 if kkz_rek == 13076
replace kreis_unemprate1993 = 13.1 if kkz_rek == 14511
replace kreis_unemprate1993 = 18.32 if kkz_rek == 14521
replace kreis_unemprate1993 = 17.3 if kkz_rek == 14522
replace kreis_unemprate1993 = 15.18 if kkz_rek == 14523
replace kreis_unemprate1993 = 17.23 if kkz_rek == 14524
replace kreis_unemprate1993 = 11.1 if kkz_rek == 14612
replace kreis_unemprate1993 = 15.45 if kkz_rek == 14625
replace kreis_unemprate1993 = 17.31 if kkz_rek == 14626
replace kreis_unemprate1993 = 16 if kkz_rek == 14627
replace kreis_unemprate1993 = 14.98 if kkz_rek == 14628
replace kreis_unemprate1993 = 11.9 if kkz_rek == 14713
replace kreis_unemprate1993 = 13.99 if kkz_rek == 14729
replace kreis_unemprate1993 = 15.25 if kkz_rek == 14730
replace kreis_unemprate1993 = 17.5 if kkz_rek == 15001
replace kreis_unemprate1993 = 13.7 if kkz_rek == 15002
replace kreis_unemprate1993 = 14 if kkz_rek == 15003
replace kreis_unemprate1993 = 16.2 if kkz_rek == 15081
replace kreis_unemprate1993 = 18.13 if kkz_rek == 15082
replace kreis_unemprate1993 = 17.52 if kkz_rek == 15083
replace kreis_unemprate1993 = 18.95 if kkz_rek == 15084
replace kreis_unemprate1993 = 19.17 if kkz_rek == 15085
replace kreis_unemprate1993 = 16.82 if kkz_rek == 15086
replace kreis_unemprate1993 = 20.41 if kkz_rek == 15087
replace kreis_unemprate1993 = 15.87 if kkz_rek == 15088
replace kreis_unemprate1993 = 19.48 if kkz_rek == 15089
replace kreis_unemprate1993 = 18.26 if kkz_rek == 15090
replace kreis_unemprate1993 = 19.15 if kkz_rek == 15091
replace kreis_unemprate1993 = 13.3 if kkz_rek == 16051
replace kreis_unemprate1993 = 15.4 if kkz_rek == 16052
replace kreis_unemprate1993 = 10.8 if kkz_rek == 16053
replace kreis_unemprate1993 = 14.8 if kkz_rek == 16054
replace kreis_unemprate1993 = 12.3 if kkz_rek == 16055
replace kreis_unemprate1993 = 18.3 if kkz_rek == 16056
replace kreis_unemprate1993 = 17.08 if kkz_rek == 16061
replace kreis_unemprate1993 = 17.11 if kkz_rek == 16062
replace kreis_unemprate1993 = 17.18 if kkz_rek == 16063
replace kreis_unemprate1993 = 20.31 if kkz_rek == 16064
replace kreis_unemprate1993 = 19.5 if kkz_rek == 16065
replace kreis_unemprate1993 = 15.76 if kkz_rek == 16066
replace kreis_unemprate1993 = 17.96 if kkz_rek == 16067
replace kreis_unemprate1993 = 19.8 if kkz_rek == 16068
replace kreis_unemprate1993 = 14.4 if kkz_rek == 16069
replace kreis_unemprate1993 = 22.08 if kkz_rek == 16070
replace kreis_unemprate1993 = 16.39 if kkz_rek == 16071
replace kreis_unemprate1993 = 14 if kkz_rek == 16072
replace kreis_unemprate1993 = 15.19 if kkz_rek == 16073
replace kreis_unemprate1993 = 14.12 if kkz_rek == 16074
replace kreis_unemprate1993 = 14.6 if kkz_rek == 16075
replace kreis_unemprate1993 = 16.24 if kkz_rek == 16076
replace kreis_unemprate1993 = 20.3 if kkz_rek == 16077

* 2018
gen kreis_unemprate2018 = .
replace kreis_unemprate2018 = 8.3 if kkz_rek == 1001
replace kreis_unemprate2018 = 8.2 if kkz_rek == 1002
replace kreis_unemprate2018 = 7.8 if kkz_rek == 1003
replace kreis_unemprate2018 = 8.3 if kkz_rek == 1004
replace kreis_unemprate2018 = 6.3 if kkz_rek == 1051
replace kreis_unemprate2018 = 5 if kkz_rek == 1053
replace kreis_unemprate2018 = 5.3 if kkz_rek == 1054
replace kreis_unemprate2018 = 5.1 if kkz_rek == 1055
replace kreis_unemprate2018 = 4.6 if kkz_rek == 1056
replace kreis_unemprate2018 = 4.5 if kkz_rek == 1057
replace kreis_unemprate2018 = 4.3 if kkz_rek == 1058
replace kreis_unemprate2018 = 5.3 if kkz_rek == 1059
replace kreis_unemprate2018 = 4.3 if kkz_rek == 1060
replace kreis_unemprate2018 = 5.6 if kkz_rek == 1061
replace kreis_unemprate2018 = 3.2 if kkz_rek == 1062
replace kreis_unemprate2018 = 5.3 if kkz_rek == 3101
replace kreis_unemprate2018 = 9.3 if kkz_rek == 3102
replace kreis_unemprate2018 = 4.8 if kkz_rek == 3103
replace kreis_unemprate2018 = 4.4 if kkz_rek == 3151
replace kreis_unemprate2018 = 6.4 if kkz_rek == 3153
replace kreis_unemprate2018 = 6.2 if kkz_rek == 3154
replace kreis_unemprate2018 = 5.4 if kkz_rek == 3155
replace kreis_unemprate2018 = 4.8 if kkz_rek == 3157
replace kreis_unemprate2018 = 4.9 if kkz_rek == 3158
replace kreis_unemprate2018 = 5.7 if kkz_rek == 3159
replace kreis_unemprate2018 = 6.6 if kkz_rek == 3241
replace kreis_unemprate2018 = 3.9 if kkz_rek == 3251
replace kreis_unemprate2018 = 6.2 if kkz_rek == 3252
replace kreis_unemprate2018 = 6 if kkz_rek == 3254
replace kreis_unemprate2018 = 6.5 if kkz_rek == 3255
replace kreis_unemprate2018 = 4.8 if kkz_rek == 3256
replace kreis_unemprate2018 = 6.1 if kkz_rek == 3257
replace kreis_unemprate2018 = 6.2 if kkz_rek == 3351
replace kreis_unemprate2018 = 5.2 if kkz_rek == 3352
replace kreis_unemprate2018 = 3.9 if kkz_rek == 3353
replace kreis_unemprate2018 = 7.5 if kkz_rek == 3354
replace kreis_unemprate2018 = 5.4 if kkz_rek == 3355
replace kreis_unemprate2018 = 3.4 if kkz_rek == 3356
replace kreis_unemprate2018 = 4 if kkz_rek == 3357
replace kreis_unemprate2018 = 5.5 if kkz_rek == 3358
replace kreis_unemprate2018 = 5.2 if kkz_rek == 3359
replace kreis_unemprate2018 = 5.4 if kkz_rek == 3360
replace kreis_unemprate2018 = 4.3 if kkz_rek == 3361
replace kreis_unemprate2018 = 9.2 if kkz_rek == 3401
replace kreis_unemprate2018 = 8.1 if kkz_rek == 3402
replace kreis_unemprate2018 = 6.5 if kkz_rek == 3403
replace kreis_unemprate2018 = 7 if kkz_rek == 3404
replace kreis_unemprate2018 = 10.7 if kkz_rek == 3405
replace kreis_unemprate2018 = 3.8 if kkz_rek == 3451
replace kreis_unemprate2018 = 6.6 if kkz_rek == 3452
replace kreis_unemprate2018 = 4 if kkz_rek == 3453
replace kreis_unemprate2018 = 2.5 if kkz_rek == 3454
replace kreis_unemprate2018 = 4.7 if kkz_rek == 3455
replace kreis_unemprate2018 = 3 if kkz_rek == 3456
replace kreis_unemprate2018 = 5.6 if kkz_rek == 3457
replace kreis_unemprate2018 = 3.5 if kkz_rek == 3458
replace kreis_unemprate2018 = 3.1 if kkz_rek == 3459
replace kreis_unemprate2018 = 3.5 if kkz_rek == 3460
replace kreis_unemprate2018 = 6.4 if kkz_rek == 3461
replace kreis_unemprate2018 = 5.6 if kkz_rek == 3462
replace kreis_unemprate2018 = 9.3 if kkz_rek == 4011
replace kreis_unemprate2018 = 12.6 if kkz_rek == 4012
replace kreis_unemprate2018 = 6.7 if kkz_rek == 5111
replace kreis_unemprate2018 = 11.4 if kkz_rek == 5112
replace kreis_unemprate2018 = 10.6 if kkz_rek == 5113
replace kreis_unemprate2018 = 10.2 if kkz_rek == 5114
replace kreis_unemprate2018 = 9.8 if kkz_rek == 5116
replace kreis_unemprate2018 = 7.4 if kkz_rek == 5117
replace kreis_unemprate2018 = 10.2 if kkz_rek == 5119
replace kreis_unemprate2018 = 7.4 if kkz_rek == 5120
replace kreis_unemprate2018 = 7.6 if kkz_rek == 5122
replace kreis_unemprate2018 = 8.3 if kkz_rek == 5124
replace kreis_unemprate2018 = 5.6 if kkz_rek == 5154
replace kreis_unemprate2018 = 5.8 if kkz_rek == 5158
replace kreis_unemprate2018 = 5.3 if kkz_rek == 5162
replace kreis_unemprate2018 = 5.9 if kkz_rek == 5166
replace kreis_unemprate2018 = 6.3 if kkz_rek == 5170
replace kreis_unemprate2018 = 6.4 if kkz_rek == 5314
replace kreis_unemprate2018 = 7.9 if kkz_rek == 5315
replace kreis_unemprate2018 = 7.2 if kkz_rek == 5316
replace kreis_unemprate2018 = 7 if kkz_rek == 5334
replace kreis_unemprate2018 = 6.7 if kkz_rek == 5358
replace kreis_unemprate2018 = 6.1 if kkz_rek == 5362
replace kreis_unemprate2018 = 5.1 if kkz_rek == 5366
replace kreis_unemprate2018 = 5.2 if kkz_rek == 5370
replace kreis_unemprate2018 = 4.6 if kkz_rek == 5374
replace kreis_unemprate2018 = 5.3 if kkz_rek == 5378
replace kreis_unemprate2018 = 4.9 if kkz_rek == 5382
replace kreis_unemprate2018 = 6.8 if kkz_rek == 5512
replace kreis_unemprate2018 = 13.2 if kkz_rek == 5513
replace kreis_unemprate2018 = 5 if kkz_rek == 5515
replace kreis_unemprate2018 = 3.4 if kkz_rek == 5554
replace kreis_unemprate2018 = 2.7 if kkz_rek == 5558
replace kreis_unemprate2018 = 9.2 if kkz_rek == 5562
replace kreis_unemprate2018 = 4 if kkz_rek == 5566
replace kreis_unemprate2018 = 4.9 if kkz_rek == 5570
replace kreis_unemprate2018 = 7.1 if kkz_rek == 5711
replace kreis_unemprate2018 = 4 if kkz_rek == 5754
replace kreis_unemprate2018 = 5.3 if kkz_rek == 5758
replace kreis_unemprate2018 = 3.9 if kkz_rek == 5762
replace kreis_unemprate2018 = 6.1 if kkz_rek == 5766
replace kreis_unemprate2018 = 4.7 if kkz_rek == 5770
replace kreis_unemprate2018 = 5.1 if kkz_rek == 5774
replace kreis_unemprate2018 = 8.9 if kkz_rek == 5911
replace kreis_unemprate2018 = 10.3 if kkz_rek == 5913
replace kreis_unemprate2018 = 9.3 if kkz_rek == 5914
replace kreis_unemprate2018 = 8.7 if kkz_rek == 5915
replace kreis_unemprate2018 = 10.9 if kkz_rek == 5916
replace kreis_unemprate2018 = 5.8 if kkz_rek == 5954
replace kreis_unemprate2018 = 4.1 if kkz_rek == 5958
replace kreis_unemprate2018 = 5.9 if kkz_rek == 5962
replace kreis_unemprate2018 = 3.4 if kkz_rek == 5966
replace kreis_unemprate2018 = 4.6 if kkz_rek == 5970
replace kreis_unemprate2018 = 5.1 if kkz_rek == 5974
replace kreis_unemprate2018 = 7.1 if kkz_rek == 5978
replace kreis_unemprate2018 = 5.2 if kkz_rek == 6411
replace kreis_unemprate2018 = 5.4 if kkz_rek == 6412
replace kreis_unemprate2018 = 9.2 if kkz_rek == 6413
replace kreis_unemprate2018 = 7 if kkz_rek == 6414
replace kreis_unemprate2018 = 3.7 if kkz_rek == 6431
replace kreis_unemprate2018 = 4.5 if kkz_rek == 6432
replace kreis_unemprate2018 = 4.8 if kkz_rek == 6433
replace kreis_unemprate2018 = 3.4 if kkz_rek == 6434
replace kreis_unemprate2018 = 4.2 if kkz_rek == 6435
replace kreis_unemprate2018 = 3.4 if kkz_rek == 6436
replace kreis_unemprate2018 = 4.4 if kkz_rek == 6437
replace kreis_unemprate2018 = 4.2 if kkz_rek == 6438
replace kreis_unemprate2018 = 4.1 if kkz_rek == 6439
replace kreis_unemprate2018 = 3.9 if kkz_rek == 6440
replace kreis_unemprate2018 = 5.2 if kkz_rek == 6531
replace kreis_unemprate2018 = 5.1 if kkz_rek == 6532
replace kreis_unemprate2018 = 4.2 if kkz_rek == 6533
replace kreis_unemprate2018 = 3.7 if kkz_rek == 6534
replace kreis_unemprate2018 = 3.7 if kkz_rek == 6535
replace kreis_unemprate2018 = 7.4 if kkz_rek == 6611
replace kreis_unemprate2018 = 2.8 if kkz_rek == 6631
replace kreis_unemprate2018 = 4 if kkz_rek == 6632
replace kreis_unemprate2018 = 3.8 if kkz_rek == 6633
replace kreis_unemprate2018 = 3.4 if kkz_rek == 6634
replace kreis_unemprate2018 = 3.5 if kkz_rek == 6635
replace kreis_unemprate2018 = 4.8 if kkz_rek == 6636
replace kreis_unemprate2018 = 5.8 if kkz_rek == 7111
replace kreis_unemprate2018 = 3.5 if kkz_rek == 7131
replace kreis_unemprate2018 = 4.4 if kkz_rek == 7132
replace kreis_unemprate2018 = 5.8 if kkz_rek == 7133
replace kreis_unemprate2018 = 5.6 if kkz_rek == 7134
replace kreis_unemprate2018 = 3.1 if kkz_rek == 7135
replace kreis_unemprate2018 = 3.4 if kkz_rek == 7137
replace kreis_unemprate2018 = 4.8 if kkz_rek == 7138
replace kreis_unemprate2018 = 3.5 if kkz_rek == 7140
replace kreis_unemprate2018 = 3.2 if kkz_rek == 7141
replace kreis_unemprate2018 = 2.9 if kkz_rek == 7143
replace kreis_unemprate2018 = 4.5 if kkz_rek == 7211
replace kreis_unemprate2018 = 3.2 if kkz_rek == 7231
replace kreis_unemprate2018 = 2.6 if kkz_rek == 7232
replace kreis_unemprate2018 = 3.8 if kkz_rek == 7233
replace kreis_unemprate2018 = 2.7 if kkz_rek == 7235
replace kreis_unemprate2018 = 6.5 if kkz_rek == 7311
replace kreis_unemprate2018 = 9 if kkz_rek == 7312
replace kreis_unemprate2018 = 4.9 if kkz_rek == 7313
replace kreis_unemprate2018 = 7.8 if kkz_rek == 7314
replace kreis_unemprate2018 = 5.5 if kkz_rek == 7315
replace kreis_unemprate2018 = 5 if kkz_rek == 7316
replace kreis_unemprate2018 = 11.6 if kkz_rek == 7317
replace kreis_unemprate2018 = 5.6 if kkz_rek == 7318
replace kreis_unemprate2018 = 6.6 if kkz_rek == 7319
replace kreis_unemprate2018 = 5.6 if kkz_rek == 7320
replace kreis_unemprate2018 = 3.7 if kkz_rek == 7331
replace kreis_unemprate2018 = 3.6 if kkz_rek == 7332
replace kreis_unemprate2018 = 4.5 if kkz_rek == 7333
replace kreis_unemprate2018 = 3.8 if kkz_rek == 7334
replace kreis_unemprate2018 = 4.7 if kkz_rek == 7335
replace kreis_unemprate2018 = 4.4 if kkz_rek == 7336
replace kreis_unemprate2018 = 3.7 if kkz_rek == 7337
replace kreis_unemprate2018 = 3.3 if kkz_rek == 7338
replace kreis_unemprate2018 = 3.4 if kkz_rek == 7339
replace kreis_unemprate2018 = 3.9 if kkz_rek == 7340
replace kreis_unemprate2018 = 4.2 if kkz_rek == 8111
replace kreis_unemprate2018 = 2.8 if kkz_rek == 8115
replace kreis_unemprate2018 = 3.1 if kkz_rek == 8116
replace kreis_unemprate2018 = 3.4 if kkz_rek == 8117
replace kreis_unemprate2018 = 3 if kkz_rek == 8118
replace kreis_unemprate2018 = 3 if kkz_rek == 8119
replace kreis_unemprate2018 = 4.9 if kkz_rek == 8121
replace kreis_unemprate2018 = 3 if kkz_rek == 8125
replace kreis_unemprate2018 = 2.3 if kkz_rek == 8126
replace kreis_unemprate2018 = 2.8 if kkz_rek == 8127
replace kreis_unemprate2018 = 2.6 if kkz_rek == 8128
replace kreis_unemprate2018 = 3.8 if kkz_rek == 8135
replace kreis_unemprate2018 = 2.7 if kkz_rek == 8136
replace kreis_unemprate2018 = 4.7 if kkz_rek == 8211
replace kreis_unemprate2018 = 4.1 if kkz_rek == 8212
replace kreis_unemprate2018 = 2.8 if kkz_rek == 8215
replace kreis_unemprate2018 = 2.8 if kkz_rek == 8216
replace kreis_unemprate2018 = 4 if kkz_rek == 8221
replace kreis_unemprate2018 = 4.9 if kkz_rek == 8222
replace kreis_unemprate2018 = 3.2 if kkz_rek == 8225
replace kreis_unemprate2018 = 3.7 if kkz_rek == 8226
replace kreis_unemprate2018 = 5.7 if kkz_rek == 8231
replace kreis_unemprate2018 = 2.8 if kkz_rek == 8235
replace kreis_unemprate2018 = 2.3 if kkz_rek == 8236
replace kreis_unemprate2018 = 2.7 if kkz_rek == 8237
replace kreis_unemprate2018 = 4.9 if kkz_rek == 8311
replace kreis_unemprate2018 = 2.8 if kkz_rek == 8315
replace kreis_unemprate2018 = 2.6 if kkz_rek == 8316
replace kreis_unemprate2018 = 2.9 if kkz_rek == 8317
replace kreis_unemprate2018 = 2.2 if kkz_rek == 8325
replace kreis_unemprate2018 = 2.8 if kkz_rek == 8326
replace kreis_unemprate2018 = 2.5 if kkz_rek == 8327
replace kreis_unemprate2018 = 3.1 if kkz_rek == 8335
replace kreis_unemprate2018 = 3.1 if kkz_rek == 8336
replace kreis_unemprate2018 = 2.8 if kkz_rek == 8337
replace kreis_unemprate2018 = 3.2 if kkz_rek == 8415
replace kreis_unemprate2018 = 2.7 if kkz_rek == 8416
replace kreis_unemprate2018 = 3.1 if kkz_rek == 8417
replace kreis_unemprate2018 = 3.3 if kkz_rek == 8421
replace kreis_unemprate2018 = 2.3 if kkz_rek == 8425
replace kreis_unemprate2018 = 2.1 if kkz_rek == 8426
replace kreis_unemprate2018 = 2.5 if kkz_rek == 8435
replace kreis_unemprate2018 = 2.5 if kkz_rek == 8436
replace kreis_unemprate2018 = 2.8 if kkz_rek == 8437
replace kreis_unemprate2018 = 2.9 if kkz_rek == 9161
replace kreis_unemprate2018 = 3.8 if kkz_rek == 9162
replace kreis_unemprate2018 = 4.1 if kkz_rek == 9163
replace kreis_unemprate2018 = 2.9 if kkz_rek == 9171
replace kreis_unemprate2018 = 3.5 if kkz_rek == 9172
replace kreis_unemprate2018 = 2.1 if kkz_rek == 9173
replace kreis_unemprate2018 = 2 if kkz_rek == 9174
replace kreis_unemprate2018 = 1.9 if kkz_rek == 9175
replace kreis_unemprate2018 = 1.3 if kkz_rek == 9176
replace kreis_unemprate2018 = 1.8 if kkz_rek == 9177
replace kreis_unemprate2018 = 2 if kkz_rek == 9178
replace kreis_unemprate2018 = 2.5 if kkz_rek == 9179
replace kreis_unemprate2018 = 2.9 if kkz_rek == 9180
replace kreis_unemprate2018 = 2.3 if kkz_rek == 9181
replace kreis_unemprate2018 = 2.3 if kkz_rek == 9182
replace kreis_unemprate2018 = 3.1 if kkz_rek == 9183
replace kreis_unemprate2018 = 2.4 if kkz_rek == 9184
replace kreis_unemprate2018 = 1.9 if kkz_rek == 9185
replace kreis_unemprate2018 = 1.6 if kkz_rek == 9186
replace kreis_unemprate2018 = 2.3 if kkz_rek == 9187
replace kreis_unemprate2018 = 2.5 if kkz_rek == 9188
replace kreis_unemprate2018 = 2.7 if kkz_rek == 9189
replace kreis_unemprate2018 = 2.3 if kkz_rek == 9190
replace kreis_unemprate2018 = 4.1 if kkz_rek == 9261
replace kreis_unemprate2018 = 4.2 if kkz_rek == 9262
replace kreis_unemprate2018 = 4.3 if kkz_rek == 9263
replace kreis_unemprate2018 = 2.7 if kkz_rek == 9271
replace kreis_unemprate2018 = 2.7 if kkz_rek == 9272
replace kreis_unemprate2018 = 2.3 if kkz_rek == 9273
replace kreis_unemprate2018 = 2.4 if kkz_rek == 9274
replace kreis_unemprate2018 = 2.9 if kkz_rek == 9275
replace kreis_unemprate2018 = 3.2 if kkz_rek == 9276
replace kreis_unemprate2018 = 2.9 if kkz_rek == 9277
replace kreis_unemprate2018 = 2.3 if kkz_rek == 9278
replace kreis_unemprate2018 = 2.7 if kkz_rek == 9279
replace kreis_unemprate2018 = 4.4 if kkz_rek == 9361
replace kreis_unemprate2018 = 3.2 if kkz_rek == 9362
replace kreis_unemprate2018 = 5.2 if kkz_rek == 9363
replace kreis_unemprate2018 = 2.4 if kkz_rek == 9371
replace kreis_unemprate2018 = 2.5 if kkz_rek == 9372
replace kreis_unemprate2018 = 1.7 if kkz_rek == 9373
replace kreis_unemprate2018 = 2.9 if kkz_rek == 9374
replace kreis_unemprate2018 = 1.8 if kkz_rek == 9375
replace kreis_unemprate2018 = 2.5 if kkz_rek == 9376
replace kreis_unemprate2018 = 3.3 if kkz_rek == 9377
replace kreis_unemprate2018 = 4 if kkz_rek == 9461
replace kreis_unemprate2018 = 4.5 if kkz_rek == 9462
replace kreis_unemprate2018 = 5 if kkz_rek == 9463
replace kreis_unemprate2018 = 5.8 if kkz_rek == 9464
replace kreis_unemprate2018 = 2.1 if kkz_rek == 9471
replace kreis_unemprate2018 = 2.8 if kkz_rek == 9472
replace kreis_unemprate2018 = 3 if kkz_rek == 9473
replace kreis_unemprate2018 = 2.5 if kkz_rek == 9474
replace kreis_unemprate2018 = 2.9 if kkz_rek == 9475
replace kreis_unemprate2018 = 2.8 if kkz_rek == 9476
replace kreis_unemprate2018 = 3.4 if kkz_rek == 9477
replace kreis_unemprate2018 = 3.3 if kkz_rek == 9478
replace kreis_unemprate2018 = 4.2 if kkz_rek == 9479
replace kreis_unemprate2018 = 3.7 if kkz_rek == 9561
replace kreis_unemprate2018 = 3.7 if kkz_rek == 9562
replace kreis_unemprate2018 = 4.9 if kkz_rek == 9563
replace kreis_unemprate2018 = 5.4 if kkz_rek == 9564
replace kreis_unemprate2018 = 3.3 if kkz_rek == 9565
replace kreis_unemprate2018 = 2.3 if kkz_rek == 9571
replace kreis_unemprate2018 = 1.9 if kkz_rek == 9572
replace kreis_unemprate2018 = 2.5 if kkz_rek == 9573
replace kreis_unemprate2018 = 2.4 if kkz_rek == 9574
replace kreis_unemprate2018 = 1.9 if kkz_rek == 9575
replace kreis_unemprate2018 = 2.2 if kkz_rek == 9576
replace kreis_unemprate2018 = 2.9 if kkz_rek == 9577
replace kreis_unemprate2018 = 4.9 if kkz_rek == 9661
replace kreis_unemprate2018 = 5.6 if kkz_rek == 9662
replace kreis_unemprate2018 = 3.6 if kkz_rek == 9663
replace kreis_unemprate2018 = 2.7 if kkz_rek == 9671
replace kreis_unemprate2018 = 2.9 if kkz_rek == 9672
replace kreis_unemprate2018 = 2.4 if kkz_rek == 9673
replace kreis_unemprate2018 = 2.4 if kkz_rek == 9674
replace kreis_unemprate2018 = 2.2 if kkz_rek == 9675
replace kreis_unemprate2018 = 2.7 if kkz_rek == 9676
replace kreis_unemprate2018 = 1.8 if kkz_rek == 9677
replace kreis_unemprate2018 = 2.3 if kkz_rek == 9678
replace kreis_unemprate2018 = 1.9 if kkz_rek == 9679
replace kreis_unemprate2018 = 5 if kkz_rek == 9761
replace kreis_unemprate2018 = 4.2 if kkz_rek == 9762
replace kreis_unemprate2018 = 3.4 if kkz_rek == 9763
replace kreis_unemprate2018 = 3.1 if kkz_rek == 9764
replace kreis_unemprate2018 = 2 if kkz_rek == 9771
replace kreis_unemprate2018 = 2.4 if kkz_rek == 9772
replace kreis_unemprate2018 = 1.8 if kkz_rek == 9773
replace kreis_unemprate2018 = 1.9 if kkz_rek == 9774
replace kreis_unemprate2018 = 2.1 if kkz_rek == 9775
replace kreis_unemprate2018 = 2.4 if kkz_rek == 9776
replace kreis_unemprate2018 = 2.2 if kkz_rek == 9777
replace kreis_unemprate2018 = 1.8 if kkz_rek == 9778
replace kreis_unemprate2018 = 1.7 if kkz_rek == 9779
replace kreis_unemprate2018 = 2.3 if kkz_rek == 9780
replace kreis_unemprate2018 = 8.6 if kkz_rek == 10041
replace kreis_unemprate2018 = 4.2 if kkz_rek == 10042
replace kreis_unemprate2018 = 6.8 if kkz_rek == 10043
replace kreis_unemprate2018 = 4.7 if kkz_rek == 10044
replace kreis_unemprate2018 = 5 if kkz_rek == 10045
replace kreis_unemprate2018 = 3.2 if kkz_rek == 10046
replace kreis_unemprate2018 = 8.8 if kkz_rek == 12051
replace kreis_unemprate2018 = 8.2 if kkz_rek == 12052
replace kreis_unemprate2018 = 8.5 if kkz_rek == 12053
replace kreis_unemprate2018 = 5.7 if kkz_rek == 12054
replace kreis_unemprate2018 = 5.7 if kkz_rek == 12060
replace kreis_unemprate2018 = 4.1 if kkz_rek == 12061
replace kreis_unemprate2018 = 7 if kkz_rek == 12062
replace kreis_unemprate2018 = 5.5 if kkz_rek == 12063
replace kreis_unemprate2018 = 6.1 if kkz_rek == 12064
replace kreis_unemprate2018 = 5.5 if kkz_rek == 12065
replace kreis_unemprate2018 = 8.4 if kkz_rek == 12066
replace kreis_unemprate2018 = 6.7 if kkz_rek == 12067
replace kreis_unemprate2018 = 6.9 if kkz_rek == 12068
replace kreis_unemprate2018 = 4.3 if kkz_rek == 12069
replace kreis_unemprate2018 = 7.8 if kkz_rek == 12070
replace kreis_unemprate2018 = 6.9 if kkz_rek == 12071
replace kreis_unemprate2018 = 4.6 if kkz_rek == 12072
replace kreis_unemprate2018 = 11.3 if kkz_rek == 12073
replace kreis_unemprate2018 = 7.8 if kkz_rek == 13003
replace kreis_unemprate2018 = 8.9 if kkz_rek == 13004
replace kreis_unemprate2018 = 9.5 if kkz_rek == 13071
replace kreis_unemprate2018 = 6 if kkz_rek == 13072
replace kreis_unemprate2018 = 9.1 if kkz_rek == 13073
replace kreis_unemprate2018 = 6.5 if kkz_rek == 13074
replace kreis_unemprate2018 = 9.4 if kkz_rek == 13075
replace kreis_unemprate2018 = 5.8 if kkz_rek == 13076
replace kreis_unemprate2018 = 7.2 if kkz_rek == 14511
replace kreis_unemprate2018 = 4.7 if kkz_rek == 14521
replace kreis_unemprate2018 = 5.2 if kkz_rek == 14522
replace kreis_unemprate2018 = 5.1 if kkz_rek == 14523
replace kreis_unemprate2018 = 4.8 if kkz_rek == 14524
replace kreis_unemprate2018 = 6.1 if kkz_rek == 14612
replace kreis_unemprate2018 = 5.6 if kkz_rek == 14625
replace kreis_unemprate2018 = 8.5 if kkz_rek == 14626
replace kreis_unemprate2018 = 6 if kkz_rek == 14627
replace kreis_unemprate2018 = 5.1 if kkz_rek == 14628
replace kreis_unemprate2018 = 6.7 if kkz_rek == 14713
replace kreis_unemprate2018 = 5.4 if kkz_rek == 14729
replace kreis_unemprate2018 = 7 if kkz_rek == 14730
replace kreis_unemprate2018 = 7.9 if kkz_rek == 15001
replace kreis_unemprate2018 = 8.9 if kkz_rek == 15002
replace kreis_unemprate2018 = 8.7 if kkz_rek == 15003
replace kreis_unemprate2018 = 7 if kkz_rek == 15081
replace kreis_unemprate2018 = 7.6 if kkz_rek == 15082
replace kreis_unemprate2018 = 5.5 if kkz_rek == 15083
replace kreis_unemprate2018 = 7.2 if kkz_rek == 15084
replace kreis_unemprate2018 = 5.8 if kkz_rek == 15085
replace kreis_unemprate2018 = 7.2 if kkz_rek == 15086
replace kreis_unemprate2018 = 10.1 if kkz_rek == 15087
replace kreis_unemprate2018 = 7 if kkz_rek == 15088
replace kreis_unemprate2018 = 9 if kkz_rek == 15089
replace kreis_unemprate2018 = 9.5 if kkz_rek == 15090
replace kreis_unemprate2018 = 7 if kkz_rek == 15091
replace kreis_unemprate2018 = 6 if kkz_rek == 16051
replace kreis_unemprate2018 = 8.8 if kkz_rek == 16052
replace kreis_unemprate2018 = 5.6 if kkz_rek == 16053
replace kreis_unemprate2018 = 4.9 if kkz_rek == 16054
replace kreis_unemprate2018 = 6.2 if kkz_rek == 16055
replace kreis_unemprate2018 = 6.6 if kkz_rek == 16056
replace kreis_unemprate2018 = 3.9 if kkz_rek == 16061
replace kreis_unemprate2018 = 7 if kkz_rek == 16062
replace kreis_unemprate2018 = 3.8 if kkz_rek == 16063
replace kreis_unemprate2018 = 7.4 if kkz_rek == 16064
replace kreis_unemprate2018 = 8.3 if kkz_rek == 16065
replace kreis_unemprate2018 = 4 if kkz_rek == 16066
replace kreis_unemprate2018 = 5 if kkz_rek == 16067
replace kreis_unemprate2018 = 5.6 if kkz_rek == 16068
replace kreis_unemprate2018 = 3.4 if kkz_rek == 16069
replace kreis_unemprate2018 = 5.3 if kkz_rek == 16070
replace kreis_unemprate2018 = 4.2 if kkz_rek == 16071
replace kreis_unemprate2018 = 3.5 if kkz_rek == 16072
replace kreis_unemprate2018 = 5.5 if kkz_rek == 16073
replace kreis_unemprate2018 = 4.5 if kkz_rek == 16074
replace kreis_unemprate2018 = 4.9 if kkz_rek == 16075
replace kreis_unemprate2018 = 5 if kkz_rek == 16076
replace kreis_unemprate2018 = 7.7 if kkz_rek == 16077


*** dichotomize UER (using median-split)
* 1993
gen kreis_unemp_dich1993 = .
replace kreis_unemp_dich1993 = 0 if kreis_unemprate1993 < 16.2 & kreis_unemprate1993 !=. & east == 1
replace kreis_unemp_dich1993 = 1 if kreis_unemprate1993 >= 16.2 & kreis_unemprate1993 !=. & east == 1

replace kreis_unemp_dich1993 = 0 if kreis_unemprate1993 < 7.5 & kreis_unemprate1993 !=. & east == 0
replace kreis_unemp_dich1993 = 1 if kreis_unemprate1993 >= 7.5 & kreis_unemprate1993 !=. & east == 0

* 2018
gen kreis_unemp_dich2018 = .
replace kreis_unemp_dich2018 = 0 if kreis_unemprate2018 < 6.35 & kreis_unemprate2018 !=. & east == 1
replace kreis_unemp_dich2018 = 1 if kreis_unemprate2018 >= 6.35 & kreis_unemprate2018 !=. & east == 1

replace kreis_unemp_dich2018 = 0 if kreis_unemprate2018 < 4 & kreis_unemprate2018 !=. & east == 0
replace kreis_unemp_dich2018 = 1 if kreis_unemprate2018 >= 4 & kreis_unemprate2018 !=. & east == 0


*** Alternative thresholds for low/high 1993 UER 
* same threshold
gen kreis_unemp_dich1993Alt1 = .
replace kreis_unemp_dich1993Alt1 = 0 if kreis_unemprate1993 < 12.3 & kreis_unemprate1993 !=. & east == 1
replace kreis_unemp_dich1993Alt1 = 1 if kreis_unemprate1993 >= 12.3 & kreis_unemprate1993 !=. & east == 1

replace kreis_unemp_dich1993Alt1 = 0 if kreis_unemprate1993 < 12.3 & kreis_unemprate1993 !=. & east == 0
replace kreis_unemp_dich1993Alt1 = 1 if kreis_unemprate1993 >= 12.3 & kreis_unemprate1993 !=. & east == 0

* similar threshold
gen kreis_unemp_dich1993Alt2 = .
replace kreis_unemp_dich1993Alt2 = 0 if kreis_unemprate1993 < 14.3 & kreis_unemprate1993 !=. & east == 1
replace kreis_unemp_dich1993Alt2 = 1 if kreis_unemprate1993 >= 14.3 & kreis_unemprate1993 !=. & east == 1

replace kreis_unemp_dich1993Alt2 = 0 if kreis_unemprate1993 < 11.44 & kreis_unemprate1993 !=. & east == 0
replace kreis_unemp_dich1993Alt2 = 1 if kreis_unemprate1993 >= 11.44 & kreis_unemprate1993 !=. & east == 0


*** define other covariates
* unemployed between 1990 and 1994
gen aux = employment_unemployed if syear >= 1990 & syear <= 1994
bysort pid: egen unemployed9094 = max(aux) if employment_unemployed !=.
soepdrop aux

gen lfs_unemployed9094 = lfs_unemployed if syear >= 1990 & syear <= 1994
bysort pid: egen aux = max(lfs_unemployed9094) if lfs_unemployed != .
replace lfs_unemployed9094 = aux
soepdrop aux

* compute democracy satisfaction in 2010
gen aux = demsatis if syear == 2010
bysort pid: egen demsatis2010 = mean(demsatis)	
soepdrop aux



*** define East-West domestic migrants
* first year in dataset
bysort pid: egen yearMIN = min(syear)

* where did they start: East or West?
gen aux = east if syear == yearMIN
bysort pid: egen eastSTART = mean(aux)
soepdrop aux

* people who have always stayed in East/West
bysort pid: egen eastMEAN = mean(east)

* identify "migrants"
gen migrant = .
replace migrant = 0 if eastMEAN ==0 | eastMEAN == 1
replace migrant = 1 if eastMEAN >0 & eastMEAN < 1

* types of migrant
gen migrantEastWest = .
replace migrantEastWest = 0 if migrant != .
replace migrantEastWest = 1 if migrant == 1 & eastSTART == 1
gen migrantWestEast = .
replace migrantWestEast = 0 if migrant != .
replace migrantWestEast = 1 if migrant == 1 & eastSTART == 0

* combine East/West and migrant
gen EastWestNew = .
replace EastWestNew = 0 if east == 0 & migrant == 0
replace EastWestNew = 1 if east == 1 & migrant == 0
replace EastWestNew = 2 if migrantEastWest == 1
replace EastWestNew = 3 if migrantWestEast == 1
label define EastWestNew 0 "West German" 1 "East German" 2 "East-West migrant" 3 "West-East migrant"
label value EastWestNew EastWestNew




*----------------------*
*** 2. Main analyses ***
*----------------------*


*** Figure 1b: Worries about economic situation by year and East/West Germans ***
*-------------------------------------------------------------------------------*

*** Means
* West Germans
sum worried_econsituation if east == 0 & syear == 1985 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 1986 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 1987 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 1988 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 1989 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 1990 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 1991 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 1992 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 1993 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 1994 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 1995 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 1996 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 1997 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 1998 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 1999 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 2000 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 2001 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 2002 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 2003 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 2004 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 2005 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 2006 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 2007 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 2008 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 2009 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 2010 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 2011 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 2012 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 2013 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 2014 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 2015 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 2016 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 2017 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 2018 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 2019 [aweight = w11103]
sum worried_econsituation if east == 0 & syear == 2020 [aweight = w11103]

* East Germans
sum worried_econsituation if east == 1 & syear == 1990 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 1991 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 1992 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 1993 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 1994 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 1995 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 1996 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 1997 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 1998 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 1999 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 2000 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 2001 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 2002 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 2003 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 2004 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 2005 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 2006 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 2007 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 2008 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 2009 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 2010 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 2011 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 2012 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 2013 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 2014 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 2015 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 2016 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 2017 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 2018 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 2019 [aweight = w11103]
sum worried_econsituation if east == 1 & syear == 2020 [aweight = w11103]	
	
	
	
*** Figure 1c: Worries about job security by year and East/West Germans ***
*-------------------------------------------------------------------------*

*** Means
* West Germany	
sum worried_jobsecurity if east == 0 & syear == 1985 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 1986 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 1987 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 1988 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 1989 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 1990 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 1991 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 1992 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 1993 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 1994 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 1995 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 1996 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 1997 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 1998 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 1999 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 2000 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 2001 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 2002 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 2003 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 2004 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 2005 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 2006 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 2007 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 2008 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 2009 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 2010 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 2011 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 2012 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 2013 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 2014 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 2015 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 2016 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 2017 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 2018 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 2019 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 0 & syear == 2020 & age >= 18 & age <= 65 [aweight = w11103]

* East Germans
sum worried_jobsecurity if east == 1 & syear == 1990 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 1991 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 1992 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 1993 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 1994 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 1995 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 1996 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 1997 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 1998 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 1999 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 2000 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 2001 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 2002 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 2003 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 2004 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 2005 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 2006 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 2007 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 2008 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 2009 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 2010 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 2011 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 2012 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 2013 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 2014 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 2015 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 2016 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 2017 & age >= 18 & age <= 65 [aweight = w11103]
sum worried_jobsecurity if east == 1 & syear == 2018 & age >= 18 & age <= 65 [aweight = w11103]	
sum worried_jobsecurity if east == 1 & syear == 2019 & age >= 18 & age <= 65 [aweight = w11103]	
sum worried_jobsecurity if east == 1 & syear == 2020 & age >= 18 & age <= 65 [aweight = w11103]	
	
	
	
	
	







*** Table 5: How democracy satisfaction relates to present-day economic insecurity in East and West Germany ***
*-------------------------------------------------------------------------------------------------------------*		

*** Regressions
eststo clear		
eststo: quietly: reghdfe demsatis c.worried_econsituation##i.east i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if (eastMEAN == 0 | eastMEAN == 1) & syear >= 1990 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)	
eststo: quietly: reghdfe demsatis c.worried_econdevelopment##i.east i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if (eastMEAN == 0 | eastMEAN == 1) & syear >= 1990 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)	
	

*** Output
esttab, se cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) star(* 0.10 ** 0.05 *** 0.01) ///
	stats(N r2_a, fmt(%9.0fc %9.3f) labels("Observations" "Adj. R-squared")) ///
	noomitted nobaselevels compress label 	
	
	
	
	
*** Table 6: Results by year born
*-------------------------------*

*** Create age cutoff
gen old = .
replace old = 1 if yearbirth <= 1975
replace old = 0 if yearbirth >= 1976 & yearbirth != .


*** Regressions
eststo clear	
eststo: quietly: reghdfe demsatis c.worried_econsituation##i.east i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if (eastMEAN == 0 | eastMEAN == 1) & syear >= 1990 & old == 0 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)
eststo: quietly: reghdfe demsatis c.worried_econsituation##i.east i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if (eastMEAN == 0 | eastMEAN == 1) & syear >= 1990 & old == 1 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)		
eststo: quietly: reghdfe demsatis c.worried_econdevelopment##i.east i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if (eastMEAN == 0 | eastMEAN == 1) & syear >= 1990 & old == 0 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)
eststo: quietly: reghdfe demsatis c.worried_econdevelopment##i.east i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if (eastMEAN == 0 | eastMEAN == 1) & syear >= 1990 & old == 1 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)	
	
	
*** Output	
esttab, se cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) star(* 0.10 ** 0.05 *** 0.01) ///
	stats(N r2_a, fmt(%9.0fc %9.3f) labels("Observations" "Adj. R-squared")) ///
	noomitted nobaselevels compress label 
	
	
	
	

*** Table 7: Results by personal experience with unemployment
*-----------------------------------------------------------*
	
*** Regressions
eststo clear	
eststo: quietly: reghdfe demsatis c.worried_econsituation##i.east i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if (eastMEAN == 0 | eastMEAN == 1) & syear >= 1990 & unemployed9094 == 0 [aweight = w11103], a(pid syear) vce(cluster pid)
eststo: quietly: reghdfe demsatis c.worried_econsituation##i.east i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if (eastMEAN == 0 | eastMEAN == 1) & syear >= 1990 & unemployed9094 == 1 [aweight = w11103], a(pid syear) vce(cluster pid)			
eststo: quietly: reghdfe demsatis c.worried_econdevelopment##i.east i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if (eastMEAN == 0 | eastMEAN == 1) & syear >= 1990 & unemployed9094 == 0 [aweight = w11103], a(pid syear) vce(cluster pid)
eststo: quietly: reghdfe demsatis c.worried_econdevelopment##i.east i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if (eastMEAN == 0 | eastMEAN == 1) & syear >= 1990 & unemployed9094 == 1 [aweight = w11103], a(pid syear) vce(cluster pid)			

*** Output	
esttab, se cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) star(* 0.10 ** 0.05 *** 0.01) ///
	stats(N r2_a, fmt(%9.0fc %9.3f) labels("Observations" "Adj. R-squared")) ///
	noomitted nobaselevels compress label 	
	

	
	
*** Table 8: Results by county-level unemployment rate in 1993
*------------------------------------------------------------*

*** Regressions
eststo clear
eststo: quietly: reghdfe demsatis c.worried_econsituation##i.kreis_unemp_dich1993 i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if eastMEAN == 1 & syear >= 1990 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)
eststo: quietly: reghdfe demsatis c.worried_econsituation##i.kreis_unemp_dich1993 i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if eastMEAN == 0 & syear >= 1990 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)
eststo: quietly: reghdfe demsatis c.worried_econdevelopment##i.kreis_unemp_dich1993 i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if eastMEAN == 1 & syear >= 1990 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)
eststo: quietly: reghdfe demsatis c.worried_econdevelopment##i.kreis_unemp_dich1993 i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if eastMEAN == 0 & syear >= 1990 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)
	
	
*** output	
esttab, se cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) star(* 0.10 ** 0.05 *** 0.01) ///
	stats(N r2_a, fmt(%9.0fc %9.3f) labels("Observations" "Adj. R-squared")) ///
	noomitted nobaselevels compress label



	
	



*-----------------*
*** 3. Appendix ***
*-----------------*

*** Table A10: Descriptive statistics ***
*---------------------------------------*

*** create some new variables
* marital status
gen marstat_single = .
replace marstat_single = 0 if marstat != 1 & marstat != .
replace marstat_single = 1 if marstat == 1

gen marstat_married = .
replace marstat_married = 0 if marstat != 2 & marstat != .
replace marstat_married = 1 if marstat == 2

gen marstat_divorced = .
replace marstat_divorced = 0 if marstat != 3 & marstat != .
replace marstat_divorced = 1 if marstat == 3

gen marstat_widowed = .
replace marstat_widowed = 0 if marstat != 4 & marstat != .
replace marstat_widowed = 1 if marstat == 4

* age group
gen agegroup_1829 = .
replace agegroup_1829 = 0 if agegroup != 1 & agegroup != .
replace agegroup_1829 = 1 if agegroup == 1

gen agegroup_3049 = .
replace agegroup_3049 = 0 if agegroup != 2 & agegroup != .
replace agegroup_3049 = 1 if agegroup == 2

gen agegroup_5064 = .
replace agegroup_5064 = 0 if agegroup != 3 & agegroup != .
replace agegroup_5064 = 1 if agegroup == 3

gen agegroup_65 = .
replace agegroup_65 = 0 if agegroup != 4 & agegroup != .
replace agegroup_65 = 1 if agegroup == 4

* employment
gen employment_fulltime = .
replace employment_fulltime = 0 if employment != 1 & employment != .
replace employment_fulltime = 1 if employment == 1

gen employment_parttime = .
replace employment_parttime = 0 if employment != 2 & employment != .
replace employment_parttime = 1 if employment == 2

gen employment_other = .
replace employment_other = 0 if employment != 3 & employment != .
replace employment_other = 1 if employment == 3

gen employment_vocational = .
replace employment_vocational = 0 if employment != 4 & employment != .
replace employment_vocational = 1 if employment == 4

gen employment_military = .
replace employment_military = 0 if employment != 5 & employment != .
replace employment_military = 1 if employment == 5

gen employment_notemployed = .
replace employment_notemployed = 0 if employment != 6 & employment != .
replace employment_notemployed = 1 if employment == 6

* East-West migrants
gen EastWestNew_west = .
replace EastWestNew_west = 0 if EastWestNew != 0 & EastWestNew != .
replace EastWestNew_west = 1 if EastWestNew == 0

gen EastWestNew_east = .
replace EastWestNew_east = 0 if EastWestNew != 1 & EastWestNew != .
replace EastWestNew_east = 1 if EastWestNew == 1

gen EastWestNew_eastwest = .
replace EastWestNew_eastwest = 0 if EastWestNew != 2 & EastWestNew != .
replace EastWestNew_eastwest = 1 if EastWestNew == 2

gen EastWestNew_westeast = .
replace EastWestNew_westeast = 0 if EastWestNew != 3 & EastWestNew != .
replace EastWestNew_westeast = 1 if EastWestNew == 3



*** statistics
sum demsatis [aweight = w11103]
sum party_support_afd [aweight = w11103]

sum worried_econsituation [aweight = w11103]
sum worried_econdevelopment [aweight = w11103]

sum east [aweight = w11103]
sum educ_years [aweight = w11103]
sum hhincome_post_adj [aweight = w11103]
sum hhincome_post_adj_log [aweight = w11103]

sum agegroup_1829 [aweight = w11103]
sum agegroup_3049 [aweight = w11103]
sum agegroup_5064 [aweight = w11103]
sum agegroup_65 [aweight = w11103]

sum employment_fulltime [aweight = w11103]
sum employment_parttime [aweight = w11103]
sum employment_other [aweight = w11103]
sum employment_vocational [aweight = w11103]
sum employment_military [aweight = w11103]
sum employment_notemployed [aweight = w11103]

sum marstat_single [aweight = w11103]
sum marstat_married [aweight = w11103]
sum marstat_divorced [aweight = w11103]
sum marstat_widowed [aweight = w11103]

sum kreis_unemprate1993 if east == 0 [aweight = w11103]
sum kreis_unemprate1993 if east == 1 [aweight = w11103]

sum EastWestNew_west [aweight = w11103]
sum EastWestNew_east [aweight = w11103]
sum EastWestNew_eastwest [aweight = w11103]
sum EastWestNew_westeast [aweight = w11103]






	
*** Table A11: Relationship between democracy satisfaction and AfD support ***
*----------------------------------------------------------------------------*	

*** Regressions
* cross-section in 2016
eststo: quietly: quietly: reghdfe party_support_afd demsatis female i.agegroup educ_years hhincome_post_adj_log ///
	i.employment i.marstat if syear == 2016 [aweight = w11103], a(kkz_rek) vce(cluster pid)	
	
* AfD 2016 on demsatis 2010
eststo: quietly: quietly: reghdfe party_support_afd demsatis2010 female i.agegroup educ_years hhincome_post_adj_log ///
	i.employment i.marstat if syear == 2016 [aweight = w11103], a(kkz_rek) vce(cluster pid)		
	
* panel
gen party_support_afd2 = party_support_afd
replace party_support_afd2 = 0 if syear == 2010
eststo: quietly: quietly: reghdfe party_support_afd2 demsatis i.agegroup educ_years hhincome_post_adj_log ///
	i.employment i.marstat if syear >= 2010 [aweight = w11103], a(pid syear kkz_rek) vce(cluster pid)

*** output	
esttab, se cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) star(* 0.10 ** 0.05 *** 0.01) ///
	stats(N r2_a, fmt(%9.0fc %9.3f) labels("Observations" "Adj. R-squared")) ///
	noomitted nobaselevels compress label 


	
	
*** Tables A12-A15: full results ***
*----------------------------------*

*** SEE CODE ABOVE (same as for Tables 5-8) ***






*** Table A16: robustness to alternative cutoff for unemployment rate (mean) ***
*------------------------------------------------------------------------------*

*** Define new cutoffs: mean-split
soepdrop kreis_unemp_dich1993
gen kreis_unemp_dich1993 = .
replace kreis_unemp_dich1993 = 0 if kreis_unemprate1993 < 16.18273 & kreis_unemprate1993 !=. & east == 1
replace kreis_unemp_dich1993 = 1 if kreis_unemprate1993 >= 16.18273 & kreis_unemprate1993 !=. & east == 1

replace kreis_unemp_dich1993 = 0 if kreis_unemprate1993 < 7.920892 & kreis_unemprate1993 !=. & east == 0
replace kreis_unemp_dich1993 = 1 if kreis_unemprate1993 >= 7.920892 & kreis_unemprate1993 !=. & east == 0


*** Regressions
* Differences by low vs. high-UER in East Germany
eststo clear
eststo: quietly: reghdfe demsatis c.worried_econsituation##i.kreis_unemp_dich1993 i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if eastMEAN == 1 & syear >= 1990 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)
eststo: quietly: reghdfe demsatis c.worried_econsituation##i.kreis_unemp_dich1993 i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if eastMEAN == 0 & syear >= 1990 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)
eststo: quietly: reghdfe demsatis c.worried_econdevelopment##i.kreis_unemp_dich1993 i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if eastMEAN == 1 & syear >= 1990 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)
eststo: quietly: reghdfe demsatis c.worried_econdevelopment##i.kreis_unemp_dich1993 i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if eastMEAN == 0 & syear >= 1990 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)


*** Output
esttab, se cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) star(* 0.10 ** 0.05 *** 0.01) ///
	stats(N r2_a, fmt(%9.0fc %9.3f) labels("Observations" "Adj. R-squared")) ///
	noomitted nobaselevels compress label 
	
	
	
*** Table A17: Addressing concerns about the use of different 1993 UER thresholds in East and West Germany ***
*------------------------------------------------------------------------------------------------------------*	
	
*** Regressions
* Median-split separate for East and West Germany
eststo clear
eststo: quietly: reghdfe demsatis c.worried_econsituation##i.kreis_unemp_dich1993##i.east i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if (eastMEAN == 0 | eastMEAN == 1) & syear >= 1990 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)
eststo: quietly: reghdfe demsatis c.worried_econdevelopment##i.kreis_unemp_dich1993##i.east i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if (eastMEAN == 0 | eastMEAN == 1) & syear >= 1990 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)
	
* Same treshold (12.3)
eststo: quietly: reghdfe demsatis c.worried_econsituation##i.kreis_unemp_dich1993Alt1##i.east i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if (eastMEAN == 0 | eastMEAN == 1) & syear >= 1990 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)
eststo: quietly: reghdfe demsatis c.worried_econdevelopment##i.kreis_unemp_dich1993Alt1##i.east i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if (eastMEAN == 0 | eastMEAN == 1) & syear >= 1990 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)
	
* Similar threshold (E = 14.3; W = 11.4)
eststo: quietly: reghdfe demsatis c.worried_econsituation##i.kreis_unemp_dich1993Alt2##i.east i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if (eastMEAN == 0 | eastMEAN == 1) & syear >= 1990 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)
eststo: quietly: reghdfe demsatis c.worried_econdevelopment##i.kreis_unemp_dich1993Alt2##i.east i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if (eastMEAN == 0 | eastMEAN == 1) & syear >= 1990 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)

* 1993 UER continuous
eststo: quietly: reghdfe demsatis c.worried_econsituation##c.kreis_unemprate1993##i.east i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if (eastMEAN == 0 | eastMEAN == 1) & syear >= 1990 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)
eststo: quietly: reghdfe demsatis c.worried_econdevelopment##c.kreis_unemprate1993##i.east i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if (eastMEAN == 0 | eastMEAN == 1) & syear >= 1990 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)

	
*** Output	
esttab, se cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) star(* 0.10 ** 0.05 *** 0.01) ///
	stats(N r2_a, fmt(%9.0fc %9.3f) labels("Observations" "Adj. R-squared")) ///
	noomitted nobaselevels compress label		
	
	
	
	
	
*** Table A18: Accounting for contemporary unemployment ***
*---------------------------------------------------------*

*** Regressions
eststo clear
eststo: quietly: reghdfe demsatis c.worried_econsituation##i.kreis_unemp_dich1993 c.worried_econsituation##i.kreis_unemp_dich2018 ///
	i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if eastMEAN == 1 & syear >= 1990 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)
eststo: quietly: reghdfe demsatis c.worried_econsituation##i.kreis_unemp_dich1993 c.worried_econsituation##i.kreis_unemp_dich2018 ///
	i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if eastMEAN == 0 & syear >= 1990 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)
eststo: quietly: reghdfe demsatis c.worried_econdevelopment##i.kreis_unemp_dich1993 c.worried_econdevelopment##i.kreis_unemp_dich2018 ///
	i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if eastMEAN == 1 & syear >= 1990 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)
eststo: quietly: reghdfe demsatis c.worried_econdevelopment##i.kreis_unemp_dich1993 c.worried_econdevelopment##i.kreis_unemp_dich2018 ///
	i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if eastMEAN == 0 & syear >= 1990 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)


*** Output
esttab, se cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) star(* 0.10 ** 0.05 *** 0.01) ///
	stats(N r2_a, fmt(%9.0fc %9.3f) labels("Observations" "Adj. R-squared")) ///
	noomitted nobaselevels compress label 
	




*** Table A19: Including internal migrants ***
*--------------------------------------------*

*** Regressions
eststo clear	
eststo: quietly: reghdfe demsatis c.worried_econsituation##i.EastWestNew i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if syear >= 1990 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)	
eststo: quietly: reghdfe demsatis c.worried_econdevelopment##i.EastWestNew i.agegroup educ_years hhincome_post_adj_log i.employment ///
	if syear >= 1990 [aweight = w11103], a(pid kkz_rek syear) vce(cluster pid)	


*** Output
esttab, se cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) star(* 0.10 ** 0.05 *** 0.01) ///
	stats(N r2_a, fmt(%9.0fc %9.3f) labels("Observations" "Adj. R-squared")) ///
	noomitted nobaselevels compress label 		

	
	
	
	
	
	
	
	
